From: Florian Müllner Date: Mon, 12 Jun 2023 21:28:54 +0000 (+0200) Subject: extensionSystem: Remove "disable" file on shutdown X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~337^2~1^2~177 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=1f080569777368bc792405431f9985b32e83a30f;p=gnome-shell.git extensionSystem: Remove "disable" file on shutdown The file indicates to the systemd shutdown scripts that extensions should be disabled, so that extensions that crash the shell on startup cannot lock out the user indefinitely. For that purpose, we create the file before initializing extensions, and remove it after 60 seconds. That generally works, because it's highly unlikely that a session genuinely ends within the first minute. It's possible though (for example during developments or when running tests), so also remove the file when shutting down cleanly before the timeout. Part-of: --- diff --git a/js/ui/extensionSystem.js b/js/ui/extensionSystem.js index 84c85f042..222ac05ed 100644 --- a/js/ui/extensionSystem.js +++ b/js/ui/extensionSystem.js @@ -57,7 +57,12 @@ var ExtensionManager = class extends Signals.EventEmitter { log(`Failed to create file ${disableFilename}: ${e.message}`); } + const shutdownId = global.connect('shutdown', + () => disableFile.delete(null)); + GLib.timeout_add_seconds(GLib.PRIORITY_DEFAULT, 60, () => { + global.context.disconnect(shutdownId); + disableFile.delete(null); return GLib.SOURCE_REMOVE; });